home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
libs
/
amigametafile.lha
/
AmigaMetaFormat
/
Docs
/
amigametaformat.doc
< prev
Wrap
Text File
|
1997-05-04
|
7KB
|
201 lines
TABLE OF CONTENTS
amigametaformat.library/--background--
amigametaformat.library/AmfOpen
amigametaformat.library/AmfFunction
amigametaformat.library/AmfClose
amigametaformat.library/--background-- amigametaformat.library/--background--
PURPOSE
The amigametaformat.library let you draw in a virtual space AND
map this TO any outputdevice, like window, rastport, metafile etc.
library-version: 6.0
amigametaformat.library/AmfOpen amigametaformat.library/AmfOpen
NAME
AmfOpen - create a amf structure
SYNOPSIS
amf = AmfOpen(channel,dataArray);
D0 A0 D0
APTR AmfOpen(ULONG, ULONG*);
FUNCTION
This routine allocs memory for the amf structure.
This routine must be called as the first.
INPUTS
channel -- outputchannel
( 1 - AMF_WINDOW, 2 - AMF_STRIP, 3 - AMF_FILE, 4 - AMF_REGION,
5 - AMF_EPS, 6 - AMF_GEM, 7 - AMF_CGM, 8 - AMF_WW,
9 - AMF_HPGL, 10 - AMF_DR2D, 11 - AMF_AI, 12 - AMF_WMF,
13 - AMF_JMF )
dataArray -- array that include the datas for the channel
( CASE channel=AMF_WINDOW
[Window struct window *,
cm struct colormap *]
CASE channel=AMF_STRIP
[RPort struct RastPort *,
xstart ULONG,
ystart ULONG,
xsize ULONG,
ysize ULONG,
cm struct colormap *,
left ULONG,
top ULONG,
right ULONG,
down ULONG]
CASE channel=AMF_FILE
[iff struct IFFHandle *,
xsize ULONG,
ysize ULONG]
CASE channel=AMF_REGION
[RPort struct RastPort *,
xstart ULONG,
ystart ULONG,
xsize ULONG,
ysize ULONG
cm struct colormap *]
CASE channel=AMF_EPS
[File filehandle *,
xsize ULONG,
ysize ULONG]
CASE channel=AMF_GEM
[File filehandle *,
xsize ULONG,
ysize ULONG]
CASE channel=AMF_CGM
[File filehandle *
xsize ULONG,
ysize ULONG]
CASE channel=AMF_WW
[File filehandle *
xsize ULONG,
ysize ULONG]
CASE channel=AMF_HPGL
[File filehandle *
xsize ULONG,
ysize ULONG]
CASE channel=AMF_DR2D
[iff struct IFFHandle *,
xsize ULONG,
ysize ULONG]
CASE channel=AMF_AI
[iff struct IFFHandle *,
xsize ULONG,
ysize ULONG]
CASE channel=AMF_WMF
[iff struct IFFHandle *,
xsize ULONG,
ysize ULONG]
CASE channel=AMF_JMF
[iff struct IFFHandle *,
xsize ULONG,
ysize ULONG]
)
- The Window must be opened and the colormap must be valid, example
screen.viewport.colormap.
This channel let you draw to a window.
- The IFFHandle must be initialized, filled with iff_Stream,
and opened.
if file=open(...)
{
if iff=allociff()
{
initiffasdos(iff);
iff.stream=file;
openiff(iff,ifff_write);
if amf=amfopen(3,...)
...
freeiff(iff)
}
close(file)
}
xsize and ysize the original size (p.e. 640x400)
This channel let you save the draw within a IFF-structure. The
structure have this ID's:
obsolete VERS: 2 ULONGs that store the Library-version with
first ULONG: version (ex: 1)
second ULONG revision (ex: 0)
FVER WB 2.0 versionstring ($VER: AmigaMetaFile x.x)
HEAD xsize ULONG
ysize ULONG
BODY: all functions (except Get... and SetDPI and SetFont to Font)
are stored in this
way:
BEGIN
function-number ULONG
count ULONG
first data from dataArray ULONG
second data ULONG
....
(count) data ULONG
END
repeated for every called function
- The RastPort must have a valid bitmap-structure.
RESULT
amf -- an initialized amf structure, or NULL on failure
NOTES
The amf structure are private only!
BUGS
Some channels are still in progress.
FUTURE
amigametaformat.library/AmfFunction amigametaformat.library/AmfFunction
NAME
AmfFunction -- select a amf Function
SYNOPSIS
result = AmfFunction(amf,dataArray,function,count);
D0 A1 A0 D1 D0
ULONG AmfFunction(APTR, ULONG*, ULONG, ULONG);
FUNCTION
Select a function from the amf functions and draw the result to
the opened channel or get the result back.
INPUTS
amf -- amf struct ready opened with AmfOpen()
dataArray -- array of ULONG with the needed datas
function -- amf function defined in amigametafile.const
count -- counter of ULONGs in dataArray
RESULT
== NULL for all draw and set functions, if there was no error
!= NULL for all draw and set functions, if there was a error
RESULT for all get functions
NOTES
Some functions on some channels are not supported.
amigametaformat.library/AmfClose amigametaformat.library/AmfClose
NAME
AmfClose -- free amf struct
SYNOPSIS
AmfClose(amf);
D0
VOID AmfClose(APTR)
FUNCTION
Free all memory allocated for amf structure.